<!-- 结算 –发票录入提示 - 弹窗组件 -->
<template>
  <div>
    <CustomDialog v-model:visible="isShowDialog">
      <div class="dialog-content">
        <div class="title">发票录入提示</div>
        <div class="description">是否对此账单进行发票录入？</div>
        <div class="btn-box">
          <div class="cancel-btn" @click="onCancel">直接结账</div>
          <div class="confirm-btn" @click="onConfirm">是</div>
        </div>
      </div>
    </CustomDialog>
  </div>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import CustomDialog from '@/components/CustomDialog/Index.vue'

interface Props {
  showDialog: boolean
}

interface Emits {
  (e: 'update:showDialog', value: boolean): void
  (e: 'onCancel'): void
  (e: 'onConfirm'): void
}

const props = withDefaults(defineProps<Props>(), {
  showDialog: false
})

const emit = defineEmits<Emits>()

const isShowDialog = computed({
  get: () => props.showDialog,
  set: val => emit('update:showDialog', val)
})

// 取消事件
const onCancel = () => {
  emit('onCancel')
  emit('update:showDialog', false)
}

// 确认提交事件
const onConfirm = () => {
  emit('onConfirm')
  emit('update:showDialog', false)
}
</script>

<style lang="scss" scoped>
.dialog-content {
  .title {
    font-size: 20px;
    font-family:
      PingFang SC,
      PingFang SC-Bold;
    font-weight: 700;
    text-align: center;
    color: #333333;
  }
  .description {
    margin-top: 70px;
    font-size: 20px;
    font-family:
      PingFang SC,
      PingFang SC-Regular;
    font-weight: 400;
    text-align: center;
    color: #353535;
  }
  .btn-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 95px;
    .cancel-btn {
      width: 190px;
      height: 60px;
      background: #ffffff;
      border: 1px solid #333333;
      border-radius: 12px;
      font-size: 18px;
      font-family:
        PingFang SC,
        PingFang SC-Regular;
      font-weight: 400;
      text-align: center;
      color: #333333;
      line-height: 60px;
      cursor: pointer;
    }
    .confirm-btn {
      width: 190px;
      height: 60px;
      background: #7c0a03;
      border-radius: 12px;
      font-size: 18px;
      font-family:
        PingFang SC,
        PingFang SC-Regular;
      font-weight: 400;
      text-align: center;
      color: #ffffff;
      line-height: 60px;
      cursor: pointer;
    }
  }
}
</style>
